<template>
	<view>
		<headerNav :navRightIcon="false" leftIconColor="#fff" title="加入" title-color="#ffffff"/>
		<view class="relative_1" style="margin: 36rpx auto 28rpx;background-color: #FFFFFF;box-sizing: border-box;padding:28rpx 30rpx 32rpx 30rpx;border-radius: 20rpx;width: 92%;">
			<view style="overflow: hidden;" class="flex items-center">
				<view style="width: 110rpx;overflow: hidden;">
					<image :src="avatar" style="width: 110rpx;height: 110rpx;border-radius: 50%;display: block;" mode=""></image>
				</view>
				<view style="padding: 0 0 0 28rpx;">
					<view style="color: #333;font-size: 28rpx;font-weight: 600;line-height: 32rpx;" class="yihang">
						{{name || ''}}
					</view>
					<view style="color: #666;font-size: 24rpx;line-height: 28rpx;margin-top: 12rpx" class="yihang pt12">
						{{jieshao || ''}}
					</view>
				</view>
			</view>
		</view>
		<view class="relative_1" style="width:88%;margin: 20rpx auto;line-height: 60rpx;color: #262D2C;font-size: 32rpx;">
			申请理由
		</view>
		<textarea   v-model="liyou" placeholder-style="color:#999;" placeholder="请输入申请理由" style="width: 92%;box-sizing: border-box;padding: 20rpx;line-height: 40rpx;font-size: 28rpx;color: #666;background-color: #fff;border-radius: 15rpx;margin: 0 auto;" />
		<view @click="shenqing" style="width: 690rpx;height: 90rpx;background: #1FB0AC;border-radius: 49rpx;line-height: 90rpx;text-align: center;color:#ffffff;font-size: 32rpx;font-weight: 600;margin:110rpx auto 0;">
			确定
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				avatar:'',
				name:'',
				jieshao:'',
				id:'',
				liyou:''
			}
		},
		onLoad(option) {
			this.avatar=option.avatar
			this.name=option.name
			this.jieshao=option.jieshao
			this.id=option.id
		},
		methods:{
			shenqing:function(){
				this.post('api/im/im/join_group',{group_id:this.id,remark:this.liyou},true).then(res=>{
					if(res.code==1){
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
						setTimeout(function(){
							uni.navigateBack({
								delta:1
							})
						},1500)
					}else{
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	page{
		background-color: #F5F5F5;
		padding-bottom: 40rpx;
		font-family: Demibold;
	}
</style>